/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.webos.java.base.frames;

import org.json.JSONObject;
import org.webos.java.base.Application;
import org.webos.java.base.Frame;
import org.webos.java.base.FrameType;
import org.webos.java.base.RemoteMessage;
import org.webos.java.base.workspace.Workspace;
import org.webos.java.root.Log;
import org.webos.java.sample.AddressBookApplication;
import org.webos.java.sessinfo.SessionsInfo;

/**
 *
 * @author kostya
 */

@FrameType(code="frame1", jsClass="core.app.Frame1")
public class Frame1 extends Frame{

    public Frame1(Application aApplication, Workspace aWorkspace) {
        super(aApplication, aWorkspace);
        setTitle("Available applications:");
    }

    @RemoteMessage
    public void sessionList(JSONObject data){
        getApplication().getSession().startApplication(SessionsInfo.class);
    }

    @RemoteMessage
    public void buttonClick(JSONObject data){
        Log.debug(this, "zzz, it works");
        getApplication().getSession().startApplication(AddressBookApplication.class);
    }
}
